<template>
	<view class="container">
		<!-- 头部信息 -->
		<view class="header">
			<view class="user-info">
				<image class="avatar" :src="getImageUrl('logo.png')"></image>
				<view class="user-details">
					<text class="username">公益行者</text>
					<text class="user-desc">每一步都是爱心的传递</text>
				</view>
			</view>
			<view class="stats">
				<view class="stat-item">
					<text class="stat-number">1,234</text>
					<text class="stat-label">今日步数</text>
				</view>
				<view class="stat-item">
					<text class="stat-number">56</text>
					<text class="stat-label">连续天数</text>
				</view>
			</view>
		</view>

		<!-- 功能区域 -->
		<view class="function-section">
			<view class="function-card" @click="goDonate">
				<view class="card-icon">🚶‍♂️</view>
				<view class="card-content">
					<text class="card-title">立即捐步</text>
					<text class="card-desc">将你的步数转化为公益力量</text>
				</view>
				<view class="card-arrow">></view>
			</view>

			<view class="function-card" @click="goPlaylist">
				<view class="card-icon">🎵</view>
				<view class="card-content">
					<text class="card-title">行走的歌单</text>
					<text class="card-desc">为你的每一步配上音乐</text>
				</view>
				<view class="card-arrow">></view>
			</view>

			<view class="function-card" @click="goAttendance">
				<view class="card-icon">🎁</view>
				<view class="card-content">
					<text class="card-title">全勤打卡好礼</text>
					<text class="card-desc">坚持打卡，收获惊喜</text>
				</view>
				<view class="card-arrow">></view>
			</view>
		</view>

		<!-- 设计图参考 -->
		<view class="design-reference">
			<text class="reference-title">设计参考图</text>
			<image class="design-image" :src="getImageUrl('体彩小程序文件夹(_F)/JPG/1021_画板 1 副本 2.jpg')" mode="aspectFit"></image>
		</view>
	</view>
</template>

<script>
	import { getImageUrl } from '@/api/config'
	
	export default {
		methods: {
			getImageUrl,
			goDonate() {
				uni.navigateTo({ url: '/pages/personal/donate' })
			},
			goPlaylist() {
				uni.navigateTo({ url: '/pages/music/playlist' })
			},
			goAttendance() {
				uni.navigateTo({ url: '/pages/personal/attendance' })
			}
		}
	}
</script>

<style>
	.container {
		min-height: 100vh;
		background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
		padding: 40rpx 30rpx;
	}

	.header {
		background: rgba(255,255,255,0.95);
		border-radius: 20rpx;
		padding: 40rpx;
		margin-bottom: 30rpx;
		box-shadow: 0 8rpx 20rpx rgba(0,0,0,0.1);
	}

	.user-info {
		display: flex;
		align-items: center;
		margin-bottom: 30rpx;
	}

	.avatar {
		width: 80rpx;
		height: 80rpx;
		border-radius: 40rpx;
		margin-right: 20rpx;
	}

	.user-details {
		flex: 1;
	}

	.username {
		display: block;
		font-size: 32rpx;
		font-weight: bold;
		color: #333333;
		margin-bottom: 8rpx;
	}

	.user-desc {
		display: block;
		font-size: 24rpx;
		color: #666666;
	}

	.stats {
		display: flex;
		justify-content: space-around;
	}

	.stat-item {
		text-align: center;
	}

	.stat-number {
		display: block;
		font-size: 36rpx;
		font-weight: bold;
		color: #667eea;
		margin-bottom: 8rpx;
	}

	.stat-label {
		display: block;
		font-size: 24rpx;
		color: #666666;
	}

	.function-section {
		margin-bottom: 40rpx;
	}

	.function-card {
		display: flex;
		align-items: center;
		background: rgba(255,255,255,0.95);
		border-radius: 20rpx;
		padding: 30rpx;
		margin-bottom: 20rpx;
		box-shadow: 0 8rpx 20rpx rgba(0,0,0,0.1);
		transition: all 0.3s ease;
	}

	.function-card:active {
		transform: scale(0.98);
	}

	.card-icon {
		font-size: 48rpx;
		margin-right: 30rpx;
	}

	.card-content {
		flex: 1;
	}

	.card-title {
		display: block;
		font-size: 32rpx;
		font-weight: bold;
		color: #333333;
		margin-bottom: 8rpx;
	}

	.card-desc {
		display: block;
		font-size: 24rpx;
		color: #666666;
	}

	.card-arrow {
		font-size: 32rpx;
		color: #999999;
	}

	.design-reference {
		background: rgba(255,255,255,0.9);
		border-radius: 20rpx;
		padding: 30rpx;
		box-shadow: 0 8rpx 20rpx rgba(0,0,0,0.1);
	}

	.reference-title {
		display: block;
		font-size: 28rpx;
		font-weight: bold;
		color: #333333;
		text-align: center;
		margin-bottom: 20rpx;
	}

	.design-image {
		width: 100%;
		max-height: 400rpx;
		border-radius: 10rpx;
	}
</style>


